<template>
  <manage-table
    class="app-container"
    :table-name="tableName"
    :service="service"
    :default-model="defaultModel"
    :table-options="options"
    ref="manageTable"></manage-table>
</template>

<script lang="ts">
  import ManageTable from '@/components/Table/ManageTable/index.vue';
  import { Options } from '@/components/Table/types';
  import { Access, accessService } from '@/services/authorization/Access';
  import { defineComponent } from 'vue';

  export default defineComponent({
    name: 'list',
    components: {
      ManageTable,
    },
    setup() {
      const tableName = 'access';
      const defaultModel: Partial<Access> = {
        id: undefined,
        code: undefined,
        remark: undefined,
      };
      const options: Options<Access> = {
        code: {
          type: 'value',
          label: '权限编码',
        },
        remark: {
          type: 'value',
          label: '备注',
        },
      };
      return {
        tableName,
        service: accessService,
        defaultModel,
        options,
      };
    },
  });
</script>
